package com.bynk.bynk_demo.service.impl;

import com.bynk.bynk_demo.dao.BookTypeMapper;
import com.bynk.bynk_demo.model.BookType;
import com.bynk.bynk_demo.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TypeServiceImpl implements TypeService {

    @Autowired
    private BookTypeMapper bookTypeMapper;

    @Override
    public List<BookType> getAllType() {


        return bookTypeMapper.selectList(null);
    }

    @Override
    public Boolean addType(BookType bookType) {

        int i = bookTypeMapper.insert(bookType);
        return i==1?true:false;
    }
}
